﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace BarManager.Core.Entity
{
    [DataContract]
    public abstract class EnvioDetalleBase
    {
        [DataMember]
        public long Id { get; set; }

        [DataMember]
        public Guid Guid { get; set; }

        [Required]
        [DataMember]
        public long EnvioId { get; set; }

        [Required]
        [DataMember]
        public int Cantidad { get; set; }      

        [Required]
        [DataMember]
        public DateTime FechaPedido { get; set; }

        [DataMember]
        public DateTime? FechaEntrega { get; set; }
              
        [DataMember]
        public abstract decimal Precio { get; }      

        [DataMember]
        public abstract decimal SubTotal { get; }              

        [DataMember]
        public virtual Envio Envio { get; set; }

        public EnvioDetalleBase()
        {
            Guid = Guid.NewGuid();
        }
    }   
}
